﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using DOAN.Public;

namespace DOAN.DLL
{
    public class ThamSoDAL
    {
        ClsConnection cls;

        public ThamSoDAL()
        {
            cls = new ClsConnection();
        }

        public DataTable Load()
        {
            return cls.GetData("THAMSO_LOAD");
        }

        public int Update(ThamSoPublic p)
        {
            int Nparameter = 4;
            string[] name = new string[Nparameter];
            object[] value = new object[Nparameter];
            name[0] = "@HanThanhToan";
            name[1] = "@NgayGuiHoaDon";
            name[2] = "@NgayThanhToanHopDong";
            name[3] = "@PhiDangKy";

            value[0] = p.HanThanhToan;
            value[1] = p.NgayGuiHoaDon;
            value[2] = p.NgayThanhToanHopDong;
            value[3] = p.PhiDangKi;

            return cls.UpdateData("THAMSO_UPDATE", name, value, Nparameter);
        }
    }
}
